package com.illtamer.infinite.sillage.pojo;

import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * SpringSecurity 上下文用户类
 * */
@Setter
@Getter
@ToString
@EqualsAndHashCode
public class SillageUserDetails implements UserDetails {

    private String username;

    private String password;

    private Collection<? extends GrantedAuthority> authorities;

    private boolean accountNonExpired = true;

    private boolean accountNonLocked = true;

    private boolean credentialsNonExpired = true;

    private boolean enabled = true;

    private User user;

    public SillageUserDetails(String username, String password, Collection<? extends GrantedAuthority> authorities, User user) {
        this.username = username;
        this.password = password;
        this.authorities = authorities;
        this.user = user;
    }

}
